﻿using Md.Api.Model;
using Md.Api.Model.Util.Oss.Request;
using Md.Api.Model.Util.Upload.Request;
using Md.Api.Model.Util.Xml.Request;
using Md.Util.Service.Oss;
using Md.Util.Service.Upload;
using Md.Util.Service.Xml;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Md.Api.Controllers;
/// <summary>
/// 工具
/// </summary>
[ApiController]
[Produces("application/json")]
[Route("md-api/util")]
public class UtilController : ControllerBase
{
    ///// <summary>
    ///// 阿里云OSS文件下载服务
    ///// </summary>
    //public AliOSSDownloadService aliOSSDownloadService { get; set; }
    ///// <summary>
    ///// 阿里云OSS文件下载
    ///// </summary>
    ///// <param name="model"></param>
    ///// <returns>ResponseJavaMessageModel</returns>
    //[Route("ali/download"), HttpPost]
    //public async Task<ResponseMessageModel> AliOSSDownload([FromBody] RequestAliOSSDownloadModel model)
    //{
    //    return await Task.Run(() => aliOSSDownloadService.Execute(model));
    //}

    ///// <summary>
    ///// 阿里云OSS文件上传服务
    ///// </summary>
    //public AliOSSUploadService aliOSSUploadService { get; set; }
    ///// <summary>
    ///// 阿里云OSS文件上传
    ///// </summary>
    ///// <param name="model"></param>
    ///// <returns>ResponseMessageModel</returns>
    //[Route("ali/upload"), HttpPost]
    //public async Task<ResponseMessageModel> AliOSSUpload([FromBody] RequestAliOSSUploadModel model)
    //{
    //    return await Task.Run(() => aliOSSUploadService.Execute(model));
    //}

    ///// <summary>
    ///// 腾讯云COS文件下载服务
    ///// </summary>
    //public TencentCosDownloadService tencentCosDownloadService { get; set; }
    ///// <summary>
    ///// 腾讯云COS文件下载
    ///// </summary>
    ///// <param name="model"></param>
    ///// <returns>ResponseJavaMessageModel</returns>
    //[Route("tencent/download"), HttpPost]
    //public async Task<ResponseMessageModel> TencentOSSDownload([FromBody] RequestTencentCosDownloadModel model)
    //{
    //    return await Task.Run(() => tencentCosDownloadService.Execute(model));
    //}

    ///// <summary>
    ///// 腾讯云OSS文件上传服务
    ///// </summary>
    //public TencentCosUploadService tencentCosUploadService { get; set; }
    ///// <summary>
    ///// 腾讯云OSS文件上传
    ///// </summary>
    ///// <param name="model"></param>
    ///// <returns>ResponseMessageModel</returns>
    //[Route("tencent/upload"), HttpPost]
    //public async Task<ResponseMessageModel> TencentOSSUpload([FromBody] RequestTencentCosUploadModel model)
    //{
    //    return await Task.Run(() => tencentCosUploadService.Execute(model));
    //}

    ///// <summary>
    ///// 分片上传文件服务
    ///// </summary>
    //public MultipartUploadService multipartUploadService { get; set; }
    ///// <summary>
    ///// 文件分片上传
    ///// </summary>
    ///// <param name="form"></param>
    ///// <returns></returns>
    //[Route("upload/multipart"), HttpPost]
    //// [ApiExplorerSettings(IgnoreApi = true)] // 让某些接口不显示在文档
    //public async Task<ResponseMessageModel> MultipartUpload([FromForm] IFormCollection form)
    //{
    //    var model = new RequestMultipartUploadModel();

    //    model.Form = form;

    //    return await Task.Run(() => multipartUploadService.Execute(model));
    //}

    ///// <summary>
    ///// 多文件上传服务
    ///// </summary>
    //public MultipleUploadService multipleUploadService { get; set; }
    ///// <summary>
    ///// 多文件上传
    ///// </summary>
    ///// <param name="form"></param>
    ///// <returns>ResponseJavaMessageModel</returns>
    //[Route("upload/multiple"), HttpPost]
    //public async Task<ResponseMessageModel> MultipleUpload([FromForm] IFormCollection form)
    //{
    //    var model = new RequestMultipleUploadModel();

    //    model.Form = form;

    //    return await Task.Run(() => multipleUploadService.Execute(model));
    //}

    ///// <summary>
    ///// 单文件上传服务
    ///// </summary>
    //public SingleUploadService singleUploadService { get; set; }
    ///// <summary>
    ///// 单文件上传
    ///// </summary>
    ///// <param name="form"></param>
    ///// <returns></returns>
    //[Route("upload/single"), HttpPost]
    //public async Task<ResponseMessageModel> SingleUpload([FromForm] IFormCollection form)
    //{
    //    var model = new RequestSingleUploadModel();

    //    model.Form = form;

    //    return await Task.Run(() => singleUploadService.Execute(model));
    //}

    ///// <summary>
    ///// XML节点属性修改服务
    ///// </summary>
    //public UpdateXmlNodeAttributeService updateXmlNodeAttributeService { get; set; }
    ///// <summary>
    ///// XML节点属性修改
    ///// </summary>
    ///// <param name="model"></param>
    ///// <returns>ResponseJavaMessageModel</returns>
    //[Route("xml/set/attribute"), HttpPost]
    //public async Task<ResponseMessageModel> UpdateXmlNodeAttribute([FromBody] RequestUpdateXmlNodeAttributeModel model)
    //{
    //    return await Task.Run(() => updateXmlNodeAttributeService.Execute(model));
    //}
}

